package cn.eastseven.demo.chat;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Main {

	private ApplicationContext ctx = null;
	
	public Main() {
		this.ctx = new ClassPathXmlApplicationContext("classpath:bean.xml");
	}
	
	public void start() throws Exception {
		ChatServer server = ctx.getBean(ChatServer.class);
		server.run();
	}
	
	public static void main(String[] args) {
		System.out.println("server start...");
		try {
			
			new Main().start();
			
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

}
